package System.Drawing;

import java.awt.Color;

public class Graphics {
	
	 

	public static void main(String[] args) {
		
		
		Bitmap tmp = new Bitmap(100, 16);
		int height=tmp.Height;
		// using ()
		Graphics g = Graphics.FromImage(tmp);
		int curCol_pixs=1;
		// int curLine=height;
		 
			int curColIdx=29;
			
			g.DrawLine(Pens.Black,curColIdx , height-curCol_pixs , curColIdx, height);
			
			tmp.toFile_overwrite("C:\\00ocr\\00charPrjkt.jpg");
		 
	}

	private Bitmap bitmap;

	public Graphics(Bitmap tmp) {
		this.bitmap=tmp;
	}

	public static Graphics FromImage(Bitmap tmp) {
			//this.bitmap=tmp;
		return new Graphics(tmp);
	}

	public void DrawLine(Pen black, int startX, int startY, int Endx, int endy) {
		
		for( int curX=startX;curX<Endx;curX++) {
			Color color =black.clr;		
			int rgb = color.getRGB();
			this.bitmap.bi.setRGB(curX, startY, rgb);
		}
		

		for( int curY=startY;curY<endy;curY++) {
			Color color =black.clr;		
			int rgb = color.getRGB();
			this.bitmap.bi.setRGB(startX, curY, rgb);
		}
		
	}

}
